<template>
  <t-dialog
    :header="`${header}-任务书详情`"
    :visible.sync="visible"
    :onClose="closeDialog"
    :closeOnOverlayClick="false"
    :confirmBtn="null"
    width="80%"
    top="5%"
    v-if="isDialog"
  >
    <div :style="{height:(reviewOpen)?'80vh':'65vh'}">
      <t-tabs  size="medium" v-model="tabValue">
        <!--    <t-tab-panel value="first" label="申报单位信息" :destroyOnHide="true">-->
        <!--    </t-tab-panel>-->
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="1" label="基本信息" :destroyOnHide="true">
          <t-sticky-tool
            :style="{ position: 'absolute', overflow: 'hidden',zIndex: 1000 }"
            :offset="[-40, -20]"
            @click="createPDF()"
          >
            <t-sticky-item  style="width: 80px" label="导出任务书PDF" >
              <template #icon>
                <t-icon name="file-pdf"></t-icon>
              </template>
            </t-sticky-item>
          </t-sticky-tool>
          <t-form labelWidth="140px">
            <t-row style="align-items: stretch" :gutter="14">
              <t-col :span="6">
                <t-card class="step-card" size="small" title="基本信息">
                  <t-form-item label="项目编号：" name="projectNum">
                    {{contractData.project.projectNum || '暂未分配'}}
                  </t-form-item>
<!--                  <t-form-item label="项目名称：" name="projectName">-->
<!--                    {{contractData.projectName?contractData.projectName:data.projectName}}-->
<!--                  </t-form-item>-->
                  <t-form-item label="项目名称：" :style="{color:contractData.projectName!==data.projectName && reviewOpen && contrastOpen?'red':''}" name="projectName">
                    {{contractData.projectName?contractData.projectName:data.projectName}}
                  </t-form-item>
                  <t-form-item v-if="site_tag === 'jtt'" label="计划类别：" name="projectCategory">
                    {{ data.projectCategory | filterByTree(projectCategoryOptions) }}
<!--                    <t-tree-select disabled clearable v-model="data.projectCategory" :treeProps="{keys: {value: 'id'}}"-->
<!--                                   :data="projectCategoryOptions" style="width: 390px"></t-tree-select>-->
                  </t-form-item>
                  <t-form-item label="学科分类：" name="subjectClassification">
                    {{data.subjectClassification | filterByDict(dict.type.subject_classification)}}
                  </t-form-item>

                  <t-form-item label="项目类型：" name="projectType">
                    {{data.projectType | filterByDict(dict.type.project_type)}}
                  </t-form-item>
                  <!--                <t-form-item label="平台类型：" name="platformType">-->
                  <!--                  {{data.platformType | filterByDict(dict.type.platform_type)}}-->
                  <!--                </t-form-item>-->
                  <t-form-item label="申报日期：" name="declareDate">
                    {{data.declareDate}}
                  </t-form-item>
                  <t-form-item label="项目开始时间：" name="startDate">
                    {{data.startDate}}
                  </t-form-item>
                  <t-form-item label="项目结束时间：" name="endDate">
                    {{data.endDate}}
                  </t-form-item>
                  <t-form-item label="关键词：" name="keyWord">
                    {{data.keyWord}}
                  </t-form-item>
                  <t-form-item label="建议经费总概算：" :style="{color:contractData.adviceFunding!==data.adviceFunding && reviewOpen && contrastOpen?'red':''}" name="adviceFunding">
                    {{contractData.adviceFunding!== null?contractData.adviceFunding:data.adviceFunding}}万元
                  </t-form-item>
                  <t-form-item :label="site_tag==='jtt'?'申请厅补助经费：':'申请集团补助经费'" :style="{color:contractData.subsidyFunding!==data.subsidyFunding && reviewOpen && contrastOpen?'red':''}" name="subsidyFunding">
                    {{contractData.subsidyFunding!== null?contractData.subsidyFunding:data.subsidyFunding}}万元
                  </t-form-item>
                  <t-form-item :style="{color:(contractData.adviceFunding!==data.adviceFunding || contractData.subsidyFunding!==data.subsidyFunding) && reviewOpen && contrastOpen?'red':''}" label="自筹经费：" name="zcFunding">
                    <div v-if="contractData.adviceFunding!==null">
                      {{ (contractData.adviceFunding*100 - contractData.subsidyFunding*100)/100}}万元
                    </div>
                    <div v-else>
                      {{ (data.adviceFunding*100 - data.subsidyFunding*100)/100}}万元
                    </div>
                  </t-form-item>
                  <t-form-item label="任务书开始时间：" name="contractData.startDate">
                    {{contractData.startDate}}
                  </t-form-item>
                  <t-form-item label="任务书结束时间：" name="contractData.completeDate">
                    {{contractData.completeDate}}
                  </t-form-item>
                </t-card>
              </t-col>
              <t-col :span="6">
                <t-card class="step-card" size="small" title="项目组情况">
                  <t-form-item label="总人数：" name="projectTeam.totalCount">
                    {{contractData.projectTeam.totalCount}}  <div v-if="reviewOpen && contrastOpen && contractData.projectTeam?.totalCount && data.projectTeam?.totalCount!==contractData.projectTeam?.totalCount" class="exception-data" ><t-icon style="margin: 0px 5px" name="arrow-left"/>{{data.projectTeam.totalCount}}</div>
                  </t-form-item>
                  <t-form-item label="高级职称人数：" name="projectTeam.highCount">
                    {{contractData.projectTeam.highCount}} <div v-if="reviewOpen && contrastOpen && contractData.projectTeam?.highCount && data.projectTeam?.highCount!==contractData.projectTeam?.highCount" class="exception-data" ><t-icon style="margin: 0px 5px" name="arrow-left"/>{{data.projectTeam.highCount}}</div>
                  </t-form-item>
                  <t-form-item label="中级职称人数：" name="projectTeam.middleCount">
                    {{contractData.projectTeam.middleCount}}<div v-if="reviewOpen && contrastOpen && contractData.projectTeam?.middleCount && data.projectTeam?.middleCount!==contractData.projectTeam?.middleCount" class="exception-data" ><t-icon style="margin: 0px 5px" name="arrow-left"/>{{data.projectTeam.middleCount}}</div>
                  </t-form-item>
                  <t-form-item label="初级职称人数：" name="projectTeam.primaryCount">
                    {{contractData.projectTeam.primaryCount}}<div v-if="reviewOpen && contrastOpen && contractData.projectTeam?.primaryCount && data.projectTeam?.primaryCount!==contractData.projectTeam?.primaryCount" class="exception-data" ><t-icon style="margin: 0px 5px" name="arrow-left"/>{{data.projectTeam.primaryCount}}</div>
                  </t-form-item>
                  <t-form-item label="研究生人数：" name="projectTeam.postgraduate">
                    {{contractData.projectTeam.postgraduate}}<div v-if="reviewOpen && contrastOpen && contractData.projectTeam?.postgraduate && data.projectTeam?.postgraduate!==contractData.projectTeam?.postgraduate" class="exception-data" ><t-icon style="margin: 0px 5px" name="arrow-left"/>{{data.projectTeam.postgraduate}}</div>
                  </t-form-item>
                  <t-form-item label="辅助人员人数：" name="projectTeam.auxilian">
                    {{contractData.projectTeam.auxilian}}<div v-if="reviewOpen && contrastOpen && contractData.projectTeam?.auxilian && data.projectTeam?.auxilian!==contractData.projectTeam?.auxilian" class="exception-data" ><t-icon style="margin: 0px 5px" name="arrow-left"/>{{data.projectTeam.auxilian}}</div>
                  </t-form-item>
                </t-card>
              </t-col>
            </t-row>
            <t-row style="align-items: stretch" :gutter="14">
              <t-col :span="6">
                <t-card class="step-card" size="small" title="项目负责人">
                  <t-form-item label="姓名：" name="projectLeader.name">
                    {{data.projectLeader.name}}
                  </t-form-item>
                  <t-form-item label="性别：" name="projectLeader.sex">
                    {{data.projectLeader.sex  | filterByDict(dict.type.sys_user_sex)}}
                  </t-form-item>
                  <t-form-item label="出生年月：" name="projectLeader.birthDate">
                    {{data.projectLeader.birthDate}}
                  </t-form-item>
                  <t-form-item label="身份证号：" name="projectLeader.idCard">
                    {{data.projectLeader.idCard}}
                  </t-form-item>
                  <t-form-item label="承担单位：" name="projectLeader.companyId">
                    {{data.declareDeptName}}
                  </t-form-item>
                  <t-form-item label="归口单位：" name="projectLeader.companyId">
                    {{data.attributeDeptName}}
                  </t-form-item>
                  <t-form-item label="联系电话：" name="projectLeader.phone">
                    {{data.projectLeader.phone}}
                  </t-form-item>
                  <t-form-item label="通讯地址：" name="projectLeader.address">
                    {{data.projectLeader.address}}
                  </t-form-item>
                  <t-form-item label="电子信箱：" name="projectLeader.email">
                    {{data.projectLeader.email}}
                  </t-form-item>
                  <t-form-item label="邮编：" name="projectLeader.postCode">
                    {{data.projectLeader.postCode}}
                  </t-form-item>
                  <t-form-item label="毕业院校：" name="projectLeader.school">
                    {{data.projectLeader.school}}
                  </t-form-item>
                  <t-form-item label="学历：" name="projectLeader.education">
                    {{data.projectLeader.education | filterByDict(dict.type.education)}}
                  </t-form-item>
                  <t-form-item label="学位：" name="projectLeader.degree">
                    {{data.projectLeader.degree   | filterByDict(dict.type.degree)}}
                  </t-form-item>
                  <t-form-item label="所学专业：" name="projectLeader.majorName">
                    {{ data.projectLeader.majorName }}
                  </t-form-item>
                  <t-form-item label="现从事专业：" name="projectLeader.majorNowName">
                    {{ data.projectLeader.majorNowName }}
                  </t-form-item>
                  <t-form-item label="职务：" name="projectLeader.duty">
                    {{data.projectLeader.duty }}
                  </t-form-item>
                  <t-form-item label="职称：" name="projectLeader.profTit">
                    {{data.projectLeader.profTit    | filterByDict(dict.type.prof_tit) }}
                  </t-form-item>
                  <t-form-item label="在本项目中承担的任务：" name="projectLeader.task">
                    {{data.projectLeader.task}}
                  </t-form-item>
                </t-card>
              </t-col>
              <t-col :span="6">
                <t-card class="step-card" size="small" title="项目联系人">
                  <t-form-item label="姓名：" name="projectLinker.name">
                    {{data.projectLinker.name}}
                  </t-form-item>
                  <t-form-item label="联系电话：" name="projectLinker.phone">
                    {{data.projectLinker.phone}}
                  </t-form-item>
                  <t-form-item label="通信地址：" name="projectLinker.address">
                    {{data.projectLinker.address}}
                  </t-form-item>
                  <t-form-item label="电子信箱：" name="projectLinker.email">
                    {{data.projectLinker.email}}
                  </t-form-item>
                  <t-form-item label="邮编：" name="projectLinker.postCode">
                    {{data.projectLinker.postCode}}
                  </t-form-item>
                </t-card>
              </t-col>
            </t-row>
          </t-form>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="2" label="研究的主要目的、内容" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（一）项目研究的主要目的">
<!--                <div v-html="contractData.contractPurposeContent.goal"></div>-->
                <inner-html :content="contractData.contractPurposeContent.goal"></inner-html>
              </t-card>

            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（二）主要研究内容（拟解决的主要技术难点和问题，主要内容和研究的创新点等">
<!--                <div v-html="contractData.contractPurposeContent.content"></div>-->
                <inner-html :content="contractData.contractPurposeContent.content"></inner-html>

              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（三）本项目的依托工程应用情况">
<!--                <div v-html="contractData.contractPurposeContent.dependingSituation"></div>-->
                <inner-html :content="contractData.contractPurposeContent.dependingSituation"></inner-html>

              </t-card>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="3" label="考核指标" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（一）主要技术指标（如形成的新技术、新产品、新材料、专利、论文、专著等数量、指标及其水平等）">
<!--                <div v-html="contractData.contractAssessIndex.technologyIndex"></div>-->
                <inner-html :content="contractData.contractAssessIndex.technologyIndex"></inner-html>

              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（二）主要经济指标（如技术及产品应用所形成的市场规模、社会经济效益等）">
<!--                <div v-html="contractData.contractAssessIndex.economicIndex"></div>-->
                <inner-html :content="contractData.contractAssessIndex.economicIndex"></inner-html>

              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（三）项目实施中形成的示范基地、中试线、生产线及其规模等">
<!--                <div v-html="contractData.contractAssessIndex.demonstrationBase"></div>-->
                <inner-html :content="contractData.contractAssessIndex.demonstrationBase"></inner-html>

              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（四）提交的研究成果及形式">
                <project-approach-expect-results phaseType="3" :projectId="contractData.project.id" ref="project-approach-expect-results" v-model="contractData.contractAssessIndex.projectExpectResults" :editOpen="false"></project-approach-expect-results>
                <!--                <div v-html="contractData.contractAssessIndex.researchResults"></div>-->
              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（五）成果转化方案">
<!--                <div v-html="contractData.contractAssessIndex.resultsConversionScheme"></div>-->
                <inner-html :content="contractData.contractAssessIndex.resultsConversionScheme"></inner-html>

              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="（六）其他考核指标">
<!--                <div v-html="contractData.contractAssessIndex.otherIndex"></div>-->
                <inner-html :content="contractData.contractAssessIndex.otherIndex"></inner-html>

              </t-card>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="4" label="研究的年度计划、目标" :destroyOnHide="true">
          <contract-year-plan v-model="contractData.contractResearchPlans" :projectId="contractData.project.id" :contractId="contractData.id" :editOpen="false" phaseType="3"></contract-year-plan>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="5" label="成果及知识产权的归属与保护" :destroyOnHide="true">
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="成果及其形成的知识产权的归属与保护">
<!--                <div v-html="contractData.contractResults.content"></div>-->
                <inner-html :content="contractData?.contractResults?.content"></inner-html>

              </t-card>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="6" label="单位信息" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <project-unit v-model="contractData.projectCompanyList" :projectId="contractData.project.id" :editOpen="false" phaseType="3"></project-unit>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="7" label="研究人员" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <project-member v-model="contractData.projectMembers" :projectId="contractData.project.id" :editOpen="false" phaseType="3"></project-member>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="8" label="项目经费" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <project-budget :contrastOpen="contrastOpen" v-model="contractData.projectBudget" :fundingObj="fundingObj"  :projectId="contractData.project.id" :editOpen="false" phaseType="3"></project-budget>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="9" label="共同条款" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <contract-terms v-model="contractData.contractTerms" :projectId="contractData.project.id" :contractId="contractData.id" :editOpen="false" phaseType="3"></contract-terms>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="10" label="按专家评审意见修改说明" :destroyOnHide="true">
          <t-row v-if="data.isOldProject === '0'" style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="专家评审意见">
                <approve-list-by-review-type review-type="2" :obj-id="objId"></approve-list-by-review-type>
              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="按专家评审意见修改说明：">
<!--                <div class="content_style" v-html="contractData.contractExplain?.content"></div>-->
                <inner-html :content="contractData.contractExplain?.content"></inner-html>

              </t-card>
            </t-col>
          </t-row>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="11" label="项目信息表" :destroyOnHide="true" >
          <div class="table-form">

            <t-row>
              <t-col :span="2" class="title">任务书(合同)编号</t-col>
              <t-col :span="4">
                {{contractData.project.projectNum}}
              </t-col>
              <t-col :span="2" class="title">项目名称</t-col>
              <t-col :span="4">
                {{contractData.projectName?contractData.projectName:contractData.project.projectName}}
              </t-col>

            </t-row>
            <t-row>
              <t-col :span="2" class="title"><span class="require">*</span>密   级</t-col>
              <t-col :span="4">
                  <t-radio-group disabled v-model="contractData.contractOthers.secretLevel" :options="dict.type.secret_level"></t-radio-group>
              </t-col>
              <t-col :span="2" class="title">参加单位总数</t-col>
              <t-col :span="4">{{contractData.contractOthers.projectCompanyList.length}}个</t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">项目承担单位</t-col>
              <t-col :span="10" style="display:block;">
                <t-row >
                  <t-col :span="2" class="title">名    称</t-col>
                  <t-col :span="10" >{{contractData.contractOthers.assumeDept.deptName}}</t-col>
                </t-row>
                <t-row >
                  <t-col :span="2" class="title">单位所在地</t-col>
                  <t-col :span="10" >{{contractData.contractOthers.assumeDept.locationId | filterParentsByTree(locationOptions)}}</t-col>
                </t-row>
                <t-row>
                  <t-col :span="2" class="title">通讯地址</t-col>
                  <t-col :span="4">
                    {{contractData.contractOthers.assumeDept.address}}
                  </t-col>
                  <t-col :span="2" class="title">邮编</t-col>
                  <t-col :span="4">
                    {{contractData.contractOthers.assumeDept.postCode}}
                  </t-col>
                </t-row>
                <t-row>
                  <t-col :span="2" class="title"><span class="require">*</span>单位性质</t-col>
                  <t-col :span="10">
                      <t-radio-group disabled v-model="contractData.contractOthers.assumeCompanyType" :options="dict.type.assume_company_type"></t-radio-group>
                  </t-col>
                </t-row>
                <t-row>
                  <t-col :span="2" class="title">归口管理单位</t-col>
                  <t-col :span="10">{{contractData.contractOthers.attributeDept.deptName}}</t-col>
                </t-row>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">合作或协作单位
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-row>
                  <t-col :span="1" class="title">序号</t-col>
                  <t-col :span="11" class="title">单位名称</t-col>
                </t-row>
                <t-row v-for="(item,index) in contractData.contractOthers.projectCompanyList.filter(val=>{return val.type==='2'})" :key="index">
                  <t-col :span="1"  style="justify-content: center">{{index+1}}</t-col>
                  <t-col :span="11" >{{ item.name }}</t-col>
                </t-row>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">项目负责人
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-row>
                  <t-col :span="1" class="title">姓名</t-col>
                  <t-col :span="3" >{{data.projectLeader.name}}</t-col>
                  <t-col :span="1" class="title">性别</t-col>
                  <t-col :span="3" >{{data.projectLeader.sex | filterByDict(dict.type.sys_user_sex)}}</t-col>
                  <t-col :span="1" class="title">出生年月</t-col>
                  <t-col :span="3" >{{data.projectLeader.birthDate}}</t-col>
                </t-row>
                <t-row>
                  <t-col :span="1" class="title">学历</t-col>
                  <t-col :span="11" >
                    {{data.projectLeader.education  | filterByDict(dict.type.education) }}
                  </t-col>
                </t-row>
                <t-row>
                  <t-col :span="1" class="title">职称</t-col>
                  <t-col :span="11" >
                    {{data.projectLeader.profTit | filterByDict(dict.type.prof_tit)}}
                  </t-col>
                </t-row>
                <t-row>
                  <t-col :span="1" class="title">专业</t-col>
                  <t-col :span="3" >
                    {{data.projectLeader.majorNowName  }}
                  </t-col>
                  <t-col :span="1" class="title">联系电话</t-col>
                  <t-col :span="3" >{{data.projectLeader.phone}}</t-col>
                  <t-col :span="1" class="title">邮箱</t-col>
                  <t-col :span="3" >{{data.projectLeader.email}}</t-col>
                </t-row>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">研究人员人数
              </t-col>
              <t-col :span="10" style="display:block;">
                共 {{contractData.projectTeam.totalCount}}   人。其中： 高级： {{contractData.projectTeam.highCount}}  人 中级： {{contractData.projectTeam.middleCount}} 人 初级： {{contractData.projectTeam.primaryCount}} 人 其他： {{contractData.projectTeam.auxilian}} 人
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">起止时间
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-row>
                  <t-col :span="2" class="title">开始时间</t-col>
                  <t-col :span="4" >{{contractData?.startDate.substring(0,4)}} 年 {{contractData?.startDate.substring(5,7)}} 月</t-col>
                  <t-col :span="2" class="title">完成时间</t-col>
                  <t-col :span="4" >{{contractData?.completeDate.substring(0,4)}} 年 {{contractData?.completeDate.substring(5,7)}} 月</t-col>
                </t-row>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">项目类型
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-radio-group disabled v-model="data.projectType" :options="dict.type.project_type"></t-radio-group>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title"><span class="require">*</span>所属技术领域
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-radio-group disabled v-model="contractData.contractOthers.technosphere" :options="dict.type.technosphere"></t-radio-group>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title"><span class="require">*</span>项目技术来源
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-radio-group disabled v-model="contractData.contractOthers.technologySource" :options="dict.type.technology_source"></t-radio-group>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title"><span class="require">*</span>主要研究内容(100字以内)
              </t-col>
              <t-col :span="10" style="display:block;">
                {{contractData.contractOthers.mainContent}}
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title"><span class="require">*</span>预期成果形式
              </t-col>
              <t-col :span="10" style="display:block;">
                  <t-checkbox-group disabled v-model="contractData.contractOthers.expectResultList" :options="dict.type.expect_result"></t-checkbox-group>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title"><span class="require">*</span>预期取得专利
              </t-col>
              <t-col :span="10" style="display:block;">
                  <t-radio-group disabled v-model="contractData.contractOthers.expectPatent" :options="dict.type.expect_patent"></t-radio-group>
              </t-col>
            </t-row>
            <t-row>
              <t-col :span="2" class="title">经费投入
              </t-col>
              <t-col :span="10" style="display:block;">
                <t-row>
                  <t-col :span="2" class="title">总经费</t-col>
                  <t-col :span="4" >{{contractData.adviceFunding}}万元</t-col>
                  <t-col :span="2" class="title">厅拨经费</t-col>
                  <t-col :span="4" >{{contractData.subsidyFunding}}万元</t-col>
                </t-row>
              </t-col>
            </t-row>
          </div>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="12" label="附件信息" :destroyOnHide="true" >
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="12">
              <t-table v-if="isMyProject" row-key="id" :columns="fileColumns" :data="fileData">
                <template #op="{row}">
                  <file-upload @success="uploadSuccess"  tips="限制pdf、图片" accept="application/pdf,image/*" v-model="row.fileIds" :moduleKey="row.moduleKey"
                               :fileList="row.fileLists"
                               :multiple="true">
                    <t-button variant="outline">
                      <t-icon name="cloud-upload" slot="icon"/>
                      点击上传
                    </t-button>
                  </file-upload>
                </template>
                <template #c1="{row}">
                  <a v-if="row.c3" class="t-button-link" :href="`${file_domain}/${row.c3}`" target="_blank">{{ row.c1 }}</a>
                  <div v-else>{{ row.c1 }}</div>
                </template>
              </t-table>
              <t-table v-else row-key="id" :columns="fileColumns" :data="fileData">
                <template #c1="{row}">
                  <a v-if="row.c3" class="t-button-link" :href="`${file_domain}/${row.c3}`" target="_blank">{{ row.c1 }}</a>
                  <div v-else>{{ row.c1 }}</div>
                </template>
                <template  #op="{row}">
                  <div v-for="(item,index) in row.fileLists" :key="index">
                    <a class="t-button-link" target="_blank" :href="item.url" >
                      {{item.name}}
                    </a>
                  </div>
<!--                  <a class="t-button-link" target="_blank" v-for="(item,index) in row.fileLists" :href="item.url" :key="index">-->
<!--                    {{item.name}}-->
<!--                  </a>-->
                </template>
              </t-table>
            </t-col>
          </t-row>
        </t-tab-panel>
      </t-tabs>
    </div>

  </t-dialog>
  <div v-else>
    <t-tabs  size="medium" v-model="tabValue">
      <!--    <t-tab-panel value="first" label="申报单位信息" :destroyOnHide="true">-->
      <!--    </t-tab-panel>-->
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="1" label="基本信息" :destroyOnHide="true">
        <t-form labelWidth="140px">
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="6">
              <t-card class="step-card" size="small" title="基本信息">
                <t-form-item label="项目编号：" name="projectNum">
                  {{contractData.project.projectNum || '暂未分配'}}
                </t-form-item>
                <t-form-item label="项目名称：" name="projectName">
                  {{contractData.projectName?contractData.projectName:data.projectName}}
                </t-form-item>
                <t-form-item v-if="site_tag === 'jtt'" label="计划类别：" name="projectCategory">
                  {{ data.projectCategory | filterByTree(projectCategoryOptions) }}
<!--                  <t-tree-select disabled clearable v-model="data.projectCategory" :treeProps="{keys: {value: 'id'}}"-->
<!--                                 :data="projectCategoryOptions" style="width: 390px"></t-tree-select>-->
                </t-form-item>
                <t-form-item label="学科分类：" name="subjectClassification">
                  {{data.subjectClassification | filterByDict(dict.type.subject_classification)}}
                </t-form-item>

                <t-form-item label="项目类型：" name="projectType">
                  {{data.projectType | filterByDict(dict.type.project_type)}}
                </t-form-item>
                <!--                <t-form-item label="平台类型：" name="platformType">-->
                <!--                  {{data.platformType | filterByDict(dict.type.platform_type)}}-->
                <!--                </t-form-item>-->
                <t-form-item label="申报日期：" name="declareDate">
                  {{data.declareDate}}
                </t-form-item>
                <t-form-item label="项目开始时间：" name="startDate">
                  {{data.startDate}}
                </t-form-item>
                <t-form-item label="项目结束时间：" name="endDate">
                  {{data.endDate}}
                </t-form-item>
                <t-form-item label="关键词：" name="keyWord">
                  {{data.keyWord}}
                </t-form-item>
                <t-form-item label="建议经费总概算：" name="adviceFunding">
                  {{contractData.adviceFunding!==null?contractData.adviceFunding:data.adviceFunding}}万元
                </t-form-item>
                <t-form-item :label="site_tag==='jtt'?'申请厅补助经费：':'申请集团补助经费'" name="subsidyFunding">
                  {{contractData.subsidyFunding!=null?contractData.subsidyFunding:data.subsidyFunding}}万元
                </t-form-item>
                <t-form-item label="自筹经费：" name="zcFunding">
                  <div v-if="contractData.adviceFunding!==null">
                    {{ (contractData.adviceFunding*100 - contractData.subsidyFunding*100)/100}}万元
                  </div>
                  <div v-else>
                    {{ (data.adviceFunding*100 - data.subsidyFunding*100)/100}}万元
                  </div>
                </t-form-item>
                <t-form-item label="任务书开始时间：" name="contractData.startDate">
                  {{contractData.startDate}}
                </t-form-item>
                <t-form-item label="任务书结束时间：" name="contractData.completeDate">
                  {{contractData.completeDate}}
                </t-form-item>
              </t-card>
            </t-col>
            <t-col :span="6">
              <t-card class="step-card" size="small" title="项目组情况">
                <t-form-item label="总人数：" name="projectTeam.totalCount">
                  {{contractData.projectTeam.totalCount}}
                </t-form-item>
                <t-form-item label="高级职称人数：" name="projectTeam.highCount">
                  {{contractData.projectTeam.highCount}}
                </t-form-item>
                <t-form-item label="中级职称人数：" name="projectTeam.middleCount">
                  {{contractData.projectTeam.middleCount}}
                </t-form-item>
                <t-form-item label="初级职称人数：" name="projectTeam.primaryCount">
                  {{contractData.projectTeam.primaryCount}}
                </t-form-item>
                <t-form-item label="研究生人数：" name="projectTeam.postgraduate">
                  {{contractData.projectTeam.postgraduate}}
                </t-form-item>
                <t-form-item label="辅助人员人数：" name="projectTeam.auxilian">
                  {{contractData.projectTeam.auxilian}}
                </t-form-item>
              </t-card>
            </t-col>
          </t-row>
          <t-row style="align-items: stretch" :gutter="14">
            <t-col :span="6">
              <t-card class="step-card" size="small" title="项目负责人">
                <t-form-item label="姓名：" name="projectLeader.name">
                  {{data.projectLeader.name}}
                </t-form-item>
                <t-form-item label="性别：" name="projectLeader.sex">
                  {{data.projectLeader.sex  | filterByDict(dict.type.sys_user_sex)}}
                </t-form-item>
                <t-form-item label="出生年月：" name="projectLeader.birthDate">
                  {{data.projectLeader.birthDate}}
                </t-form-item>
                <t-form-item label="身份证号：" name="projectLeader.idCard">
                  {{data.projectLeader.idCard}}
                </t-form-item>
                <t-form-item label="承担单位：" name="projectLeader.companyId">
                  {{data.declareDeptName}}
                </t-form-item>
                <t-form-item label="归口单位：" name="projectLeader.companyId">
                  {{data.attributeDeptName}}
                </t-form-item>
                <t-form-item label="联系电话：" name="projectLeader.phone">
                  {{data.projectLeader.phone}}
                </t-form-item>
                <t-form-item label="通讯地址：" name="projectLeader.address">
                  {{data.projectLeader.address}}
                </t-form-item>
                <t-form-item label="电子信箱：" name="projectLeader.email">
                  {{data.projectLeader.email}}
                </t-form-item>
                <t-form-item label="邮编：" name="projectLeader.postCode">
                  {{data.projectLeader.postCode}}
                </t-form-item>
                <t-form-item label="毕业院校：" name="projectLeader.school">
                  {{data.projectLeader.school}}
                </t-form-item>
                <t-form-item label="学历：" name="projectLeader.education">
                  {{data.projectLeader.education | filterByDict(dict.type.education)}}
                </t-form-item>
                <t-form-item label="学位：" name="projectLeader.degree">
                  {{data.projectLeader.degree   | filterByDict(dict.type.degree)}}
                </t-form-item>
                <t-form-item label="所学专业：" name="projectLeader.majorName">
                  {{ data.projectLeader.majorName }}
                </t-form-item>
                <t-form-item label="现从事专业：" name="projectLeader.majorNowName">
                  {{ data.projectLeader.majorNowName }}
                </t-form-item>
                <t-form-item label="职务：" name="projectLeader.duty">
                  {{data.projectLeader.duty }}
                </t-form-item>
                <t-form-item label="职称：" name="projectLeader.profTit">
                  {{data.projectLeader.profTit    | filterByDict(dict.type.prof_tit) }}
                </t-form-item>
                <t-form-item label="在本项目中承担的任务：" name="projectLeader.task">
                  {{data.projectLeader.task}}
                </t-form-item>
              </t-card>
            </t-col>
            <t-col :span="6">
              <t-card class="step-card" size="small" title="项目联系人">
                <t-form-item label="姓名：" name="projectLinker.name">
                  {{data.projectLinker.name}}
                </t-form-item>
                <t-form-item label="联系电话：" name="projectLinker.phone">
                  {{data.projectLinker.phone}}
                </t-form-item>
                <t-form-item label="通信地址：" name="projectLinker.address">
                  {{data.projectLinker.address}}
                </t-form-item>
                <t-form-item label="电子信箱：" name="projectLinker.email">
                  {{data.projectLinker.email}}
                </t-form-item>
                <t-form-item label="邮编：" name="projectLinker.postCode">
                  {{data.projectLinker.postCode}}
                </t-form-item>
              </t-card>
            </t-col>
          </t-row>
        </t-form>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="2" label="研究的主要目的、内容" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（一）项目研究的主要目的">
<!--              <div v-html="contractData.contractPurposeContent.goal"></div>-->
              <inner-html :content="contractData.contractPurposeContent.goal"></inner-html>

            </t-card>

          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（二）主要研究内容（拟解决的主要技术难点和问题，主要内容和研究的创新点等">
<!--              <div v-html="contractData.contractPurposeContent.content"></div>-->
              <inner-html :content="contractData.contractPurposeContent.content"></inner-html>

            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（三）本项目的依托工程应用情况">
<!--              <div v-html="contractData.contractPurposeContent.dependingSituation"></div>-->
              <inner-html :content="contractData.contractPurposeContent.dependingSituation"></inner-html>

            </t-card>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="3" label="考核指标" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（一）主要技术指标（如形成的新技术、新产品、新材料、专利、论文、专著等数量、指标及其水平等）">
<!--              <div v-html="contractData.contractAssessIndex.technologyIndex"></div>-->
              <inner-html :content="contractData.contractAssessIndex.technologyIndex"></inner-html>

            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（二）主要经济指标（如技术及产品应用所形成的市场规模、社会经济效益等）">
<!--              <div v-html="contractData.contractAssessIndex.economicIndex"></div>-->
              <inner-html :content="contractData.contractAssessIndex.economicIndex"></inner-html>

            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（三）项目实施中形成的示范基地、中试线、生产线及其规模等">
<!--              <div v-html="contractData.contractAssessIndex.demonstrationBase"></div>-->
              <inner-html :content="contractData.contractAssessIndex.demonstrationBase"></inner-html>

            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（四）提交的研究成果及形式">
              <project-approach-expect-results phaseType="3" :projectId="contractData.project.id" ref="project-approach-expect-results" v-model="contractData.contractAssessIndex.projectExpectResults" :editOpen="false"></project-approach-expect-results>
              <!--              <div v-html="contractData.contractAssessIndex.researchResults"></div>-->
            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（五）成果转化方案">
<!--              <div v-html="contractData.contractAssessIndex.resultsConversionScheme"></div>-->
              <inner-html :content="contractData.contractAssessIndex.resultsConversionScheme"></inner-html>

            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="（六）其他考核指标">
<!--              <div v-html="contractData.contractAssessIndex.otherIndex"></div>-->
              <inner-html :content="contractData.contractAssessIndex.otherIndex"></inner-html>

            </t-card>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="4" label="研究的年度计划、目标" :destroyOnHide="true">
        <contract-year-plan v-model="contractData.contractResearchPlans" :projectId="contractData.project.id" :contractId="contractData.id" :editOpen="false" phaseType="3"></contract-year-plan>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="5" label="成果及知识产权的归属与保护" :destroyOnHide="true">
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="成果及其形成的知识产权的归属与保护">
<!--              <div v-html="contractData.contractResults.content"></div>-->
              <inner-html :content="contractData?.contractResults?.content"></inner-html>

            </t-card>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="6" label="单位信息" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <project-unit v-model="contractData.projectCompanyList" :adviceFunding="adviceFunding" :projectId="contractData.project.id" :editOpen="false" phaseType="3"></project-unit>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="7" label="研究人员" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <project-member v-model="contractData.projectMembers" :projectId="contractData.project.id" :editOpen="false" phaseType="3"></project-member>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="8" label="项目经费" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <project-budget :contrastOpen="contrastOpen" v-model="contractData.projectBudget" :fundingObj="fundingObj" :projectId="contractData.project.id" :editOpen="false" phaseType="3"></project-budget>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="9" label="共同条款" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <contract-terms v-model="contractData.contractTerms" :projectId="contractData.project.id" :contractId="contractData.id" :editOpen="false" phaseType="3"></contract-terms>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="10" label="按大纲专家评审意见修改说明" :destroyOnHide="true">
        <t-row v-if="data.isOldProject === '0'" style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="专家评审意见">
              <approve-list-by-review-type review-type="2" :obj-id="objId"></approve-list-by-review-type>
            </t-card>
          </t-col>
        </t-row>
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-card class="step-card" size="small" title="按大纲专家评审意见修改说明：">
<!--              <div class="content_style" v-html="contractData.contractExplain?.content"></div>-->
              <inner-html :content="contractData.contractExplain?.content"></inner-html>

            </t-card>
          </t-col>
        </t-row>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="11" label="项目信息表" :destroyOnHide="true" >
        <div class="table-form">

          <t-row>
            <t-col :span="2" class="title">任务书(合同)编号</t-col>
            <t-col :span="4">
              {{contractData.project.projectNum}}
            </t-col>
            <t-col :span="2" class="title">项目名称</t-col>
            <t-col :span="4">
              {{contractData.projectName?contractData.projectName:contractData.project.projectName}}
            </t-col>

          </t-row>
          <t-row>
            <t-col :span="2" class="title"><span class="require">*</span>密   级</t-col>
            <t-col :span="4">
              <t-radio-group disabled v-model="contractData.contractOthers.secretLevel" :options="dict.type.secret_level"></t-radio-group>
            </t-col>
            <t-col :span="2" class="title">参加单位总数</t-col>
            <t-col :span="4">{{contractData.contractOthers.projectCompanyList.length}}个</t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">项目承担单位</t-col>
            <t-col :span="10" style="display:block;">
              <t-row >
                <t-col :span="2" class="title">名    称</t-col>
                <t-col :span="10" >{{contractData.contractOthers.assumeDept.deptName}}</t-col>
              </t-row>
              <t-row>
                <t-col :span="2" class="title">通讯地址</t-col>
                <t-col :span="4">
                  {{contractData.contractOthers.assumeDept.address}}
                </t-col>
                <t-col :span="2" class="title">邮编</t-col>
                <t-col :span="4">
                  {{contractData.contractOthers.assumeDept.postCode}}
                </t-col>
              </t-row>
              <t-row>
                <t-col :span="2" class="title"><span class="require">*</span>单位性质</t-col>
                <t-col :span="10">
                  <t-radio-group disabled v-model="contractData.contractOthers.assumeCompanyType" :options="dict.type.assume_company_type"></t-radio-group>
                </t-col>
              </t-row>
              <t-row>
                <t-col :span="2" class="title">归口管理单位</t-col>
                <t-col :span="10">{{contractData.contractOthers.attributeDept.deptName}}</t-col>
              </t-row>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">合作或协作单位
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-row>
                <t-col :span="1" class="title">序号</t-col>
                <t-col :span="11" class="title">单位名称</t-col>
              </t-row>
              <t-row v-for="(item,index) in contractData.contractOthers.projectCompanyList.filter(val=>{return val.type==='2'})" :key="index">
                <t-col :span="1"  style="justify-content: center">{{index+1}}</t-col>
                <t-col :span="11" >{{ item.name }}</t-col>
              </t-row>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">项目负责人
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-row>
                <t-col :span="1" class="title">姓名</t-col>
                <t-col :span="3" >{{data.projectLeader.name}}</t-col>
                <t-col :span="1" class="title">性别</t-col>
                <t-col :span="3" >{{data.projectLeader.sex | filterByDict(dict.type.sys_user_sex)}}</t-col>
                <t-col :span="1" class="title">出生年月</t-col>
                <t-col :span="3" >{{data.projectLeader.birthDate}}</t-col>
              </t-row>
              <t-row>
                <t-col :span="1" class="title">学历</t-col>
                <t-col :span="11" >
                  {{data.projectLeader.education  | filterByDict(dict.type.education) }}
                </t-col>
              </t-row>
              <t-row>
                <t-col :span="1" class="title">职称</t-col>
                <t-col :span="11" >
                  {{data.projectLeader.profTit | filterByDict(dict.type.prof_tit)}}
                </t-col>
              </t-row>
              <t-row>
                <t-col :span="1" class="title">专业</t-col>
                <t-col :span="3" >
                  {{data.projectLeader.majorNowName  }}
                </t-col>
                <t-col :span="1" class="title">联系电话</t-col>
                <t-col :span="3" >{{data.projectLeader.phone}}</t-col>
                <t-col :span="1" class="title">邮箱</t-col>
                <t-col :span="3" >{{data.projectLeader.email}}</t-col>
              </t-row>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">研究人员人数
            </t-col>
            <t-col :span="10" style="display:block;">
              共 {{contractData.projectTeam.totalCount}}   人。其中： 高级： {{contractData.projectTeam.highCount}}  人 中级： {{contractData.projectTeam.middleCount}} 人 初级： {{contractData.projectTeam.primaryCount}} 人 其他： {{contractData.projectTeam.auxilian}} 人
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">起止时间
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-row>
                <t-col :span="2" class="title">开始时间</t-col>
                <t-col :span="4" >{{contractData?.startDate.substring(0,4)}} 年 {{contractData?.startDate.substring(5,7)}} 月</t-col>
                <t-col :span="2" class="title">完成时间</t-col>
                <t-col :span="4" >{{contractData?.completeDate.substring(0,4)}} 年 {{contractData?.completeDate.substring(5,7)}} 月</t-col>
              </t-row>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">项目类型
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-radio-group disabled v-model="data.projectType" :options="dict.type.project_type"></t-radio-group>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title"><span class="require">*</span>所属技术领域
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-radio-group disabled v-model="contractData.contractOthers.technosphere" :options="dict.type.technosphere"></t-radio-group>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title"><span class="require">*</span>项目技术来源
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-radio-group disabled v-model="contractData.contractOthers.technologySource" :options="dict.type.technology_source"></t-radio-group>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title"><span class="require">*</span>主要研究内容(100字以内)
            </t-col>
            <t-col :span="10" style="display:block;">
              {{contractData.contractOthers.mainContent}}
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title"><span class="require">*</span>预期成果形式
            </t-col>
            <t-col :span="10" style="display:block;">


              <t-checkbox-group disabled v-model="contractData.contractOthers.expectResultList" :options="dict.type.expect_result"></t-checkbox-group>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title"><span class="require">*</span>预期取得专利
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-radio-group disabled v-model="contractData.contractOthers.expectPatent" :options="dict.type.expect_patent"></t-radio-group>
            </t-col>
          </t-row>
          <t-row>
            <t-col :span="2" class="title">经费投入
            </t-col>
            <t-col :span="10" style="display:block;">
              <t-row>
                <t-col :span="2" class="title">总经费</t-col>
                <t-col :span="4" >{{contractData.adviceFunding}}万元</t-col>
                <t-col :span="2" class="title">厅拨经费</t-col>
                <t-col :span="4" >{{contractData.subsidyFunding}}万元</t-col>
              </t-row>
            </t-col>
          </t-row>
        </div>
      </t-tab-panel>
      <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="12" label="附件信息" :destroyOnHide="true" >
        <t-row style="align-items: stretch" :gutter="14">
          <t-col :span="12">
            <t-table v-if="isMyProject" row-key="id" :columns="fileColumns" :data="fileData">
              <template #op="{row}">
                <file-upload @success="uploadSuccess"  tips="限制pdf、图片" accept="application/pdf,image/*" v-model="row.fileIds" :moduleKey="row.moduleKey"
                             :fileList="row.fileLists"
                             :multiple="true">
                  <t-button variant="outline">
                    <t-icon name="cloud-upload" slot="icon"/>
                    点击上传
                  </t-button>
                </file-upload>
              </template>
              <template #c1="{row}">
                <a v-if="row.c3" class="t-button-link" :href="`${file_domain}/${row.c3}`" target="_blank">{{ row.c1 }}</a>
                <div v-else>{{ row.c1 }}</div>
              </template>
            </t-table>
            <t-table v-else row-key="id" :columns="fileColumns" :data="fileData">
              <template #c1="{row}">
                <a v-if="row.c3" class="t-button-link" :href="`${file_domain}/${row.c3}`" target="_blank">{{ row.c1 }}</a>
                <div v-else>{{ row.c1 }}</div>
              </template>
              <template  #op="{row}">
                <div v-for="(item,index) in row.fileLists" :key="index">
                  <a class="t-button-link" target="_blank" :href="item.url" >
                    {{item.name}}
                  </a>
                </div>
              </template>
            </t-table>
          </t-col>
        </t-row>
      </t-tab-panel>
    </t-tabs>
  </div>
</template>

<script>
import { VITE_FILE_DOMAIN } from '@/api/upload'
import ProjectMember from '../../pm/components/project-member.vue'
import ProjectBudget from '../../pm/components/project-budget.vue'
import ProjectUnit from '../../pm/components/project-unit.vue'
import ContractYearPlan from './contract-year-plan.vue'
import ContractTerms from './contract-terms.vue'
import dayjs from "dayjs";
import {getFiles} from "@/api/common";
import FileUpload from "@/components/FileUpload/index.vue";
import ApproveListByReviewType from "../../approve/components/approve-list-by-review-type.vue";
import ProjectApproachExpectResults from "../../pm/components/project-approach-expectResults.vue";
import InnerHtml from "@/components/InnerHtml/index.vue";


export default {
  name: "project-contract-detail-dialog",
  dicts:["project_type", "subject_classification", "sys_user_sex", "prof_tit", "degree", "duty", "platform_type", "member_type","secret_level", "assume_company_type", "sys_user_sex", "expect_patent", "technology_source", "technosphere",
    "expect_result", "education"],
  components:{
    ContractYearPlan,
    ProjectUnit,
    ProjectMember,
    ProjectBudget,
    ContractTerms,
    FileUpload,
    ApproveListByReviewType,
    ProjectApproachExpectResults,
    InnerHtml
  },
  props:{
    objId: [String,Number],
    // header: String,
    isDialog:{
      type: Boolean,
      default: true
    },
    reviewOpen: {
      type: Boolean,
      default: false
    },
    contrastOpen: {
      type: Boolean,
      default: false
    }
  },
  data(){
    return {
      file_domain: VITE_FILE_DOMAIN,
      locationOptions: [],
      header: '',
      isMyProject: false,
      fileData: [
        {
          id: 1,
          c1: "已盖章任务书",
          c2: "审批通过之后，走完盖章流程后上传。",
          fileIds: [],
          fileLists: [],
          moduleKey: "projectRWS"
        },
        {
          id: 2,
          c1: "其他附件",
          c2: "审批通过之后，走完盖章流程后上传。",
          fileIds: [],
          fileLists: [],
          moduleKey: "projectRWSQT"
        }
      ],
      fileColumns: [
        {
          colKey: "id",
          title: "序号",
          align: "center",
          width: 64
        },
        {
          colKey: "c1",
          title: "附件名称",
          align: "center",
        },

        {
          colKey: "c2",
          title: "是否必需",
          align: "center",
        },
        {
          colKey: "op",
          title: "附件列表",
          align: "left",
        },
      ],
      site_tag: import.meta.env.VITE_SITE_TAG,
      visible:true,
      tabValue:"1",
      fundingObj: {subsidyFunding: 0, adviceFunding: 0},
      disableDate: {},
      adviceFunding: 0,
      contractData:{
        projectTeam:{},
        project:{},
        contractPurposeContent:{},
        contractAssessIndex:{},
        contractResearchPlans: [],
        projectCompanyList:[],
        projectMembers:[],
        projectBudget:{},
        contractTerms:[],
        contractOthers:{
          contract:{},
          projectCompanyList:[],
          assumeDept:{},
          attributeDept:{},
          projectLeader:{},
          projectTeam:{},
          project:{
            startDate:'',
            endDate:'',
          },
          expectResult: '',
          expectResultList:[]
        },
        contractExplain: {},
        startDate: '',
        completeDate: '',
      },
      data:{
        projectCategory:'',
        projectTeam:{},
        projectLeader:{},
        projectLinker:{},
        projectBackground:{
          background:''
        },
        projectApproach:{},
        projectBasicstudy:{},
        projectCompanyList:[],
        projectMembers:[],
        projectBudget:{}
      },
      projectCategoryOptions:[],
    }
  },
  watch: {
    objId: {
      immediate: true,
      handler(val) {
        if (val) {
          this.getObj(val);
        }
      }
    },
  },
  methods:{
    createPDF(){
      const instance = this.$loading({
        fullscreen: true,
        attach: 'body',
        preventScrollThrough: false,
      });
      this.$api.kjxm.contract.createPDF(this.objId, 1).then(response => {
        window.open(response.data.fullFilePath, '_blank')
        instance.hide();
      }).catch((e) => {
        instance.hide();
        this.$message.error(e.toString());
      });
    },
    uploadSuccess(ids){
      this.$api.kjxm.project.edit({
        id: this.objId,
        sysAttMainVo: {
          sysAttMainIds: ids,
        }
      }).then(val => {
        this.$message.success("上传成功");
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    async getObj(){
      await Promise.all([this.getDeclareTree(), this.getLocationTree()]);
      // 获取项目附件
      getFiles(this.objId).then((res) => {
        const files = {}
        res.data.forEach((item) => {
          if (!files[item.moduleKey]) {
            files[item.moduleKey] = []
          }
          files[item.moduleKey].push({
            name: item.fileName,
            url: item.fullFilePath,
            id: item.id,
            filePath: item.filePath
          })
        })
        this.fileData.forEach((val,index)=>{
          this.fileData[index].fileLists = files[val.moduleKey] || [];
          this.fileData[index].fileIds = files[val.moduleKey]?.map(val => val.id) || [];
        })
        // this.fileData[0].fileLists = files.projectRWS || [];
        // this.fileData[0].fileIds = files.projectRWS?.map(val => val.id) || [];

      }).catch((e) => {
        this.$message.error(e.toString());
      });
      this.$api.kjxm.project.get(this.objId).then(pro => {
        if(pro.data.createUserId===Number(this.$store.state.user.userId)){
          this.isMyProject = true;
        }
        this.data = pro.data;
        // 获取大纲 覆盖可变的字段
        this.$api.kjxm.outline.getByProject(this.objId).then(outline => {
          Object.assign(this.data, outline.data);
        }).catch((e) => {
          this.$message.error(e.toString());
        });
        // 根据当前项目限定时间
        this.disableDate = {
          before:dayjs(pro.data.startDate,"YYYY-MM-DD").endOf('month').subtract(1, 'month').format(),
          after:dayjs(pro.data.endDate,"YYYY-MM-DD").endOf('month').subtract(0, 'month').format(),
        }

        this.$api.kjxm.contract.getAll(this.objId).then(response => {
          response.data = response.data || {};
          this.header = response.data.projectName || pro.data.projectName;
          Object.assign(this.contractData, response.data)
          if(!this.contractData.contractOthers.expectResult){
            this.contractData.contractOthers.expectResult = '';
          }
          this.contractData.contractOthers.expectResultList = this.contractData.contractOthers.expectResult.split(",").filter(item=> item !== '')
          this.adviceFunding = response.data.adviceFunding;
          this.subsidyFunding = response.data.subsidyFunding;
          this.fundingObj = {
            adviceFunding: response.data.adviceFunding,
            subsidyFunding: response.data.subsidyFunding
          }
        }).catch((e) => {
          this.$message.error(e.toString());
        });
      }).catch((e) => {
        this.$message.error(e.toString());
      });

    },
    getLocationTree(){
      return this.$api.system.location.treeselect().then(response => {
        this.locationOptions = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getDeclareTree() {
      return this.$api.kjxm.project.planCategoryTree().then(response => {
        this.projectCategoryOptions = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    closeDialog() {
      this.$emit("update:visible", false);
    },
  }
}
</script>

<style lang="less" scoped>
.tab-panel{
  padding: 10px;
  height: calc(65vh - 64px);
  overflow: scroll;
}
.tab-full-panel{
  padding: 10px;
  height: calc(80vh - 64px);
  overflow: scroll;
}
.t-form__item{
  margin-bottom:6px
}

.t-row {
  margin-bottom: 14px;
}

.step-card {
  height: 100%;
  margin-bottom: 14px;
}

.table-form{
  /deep/ .t-radio.t-is-disabled .t-radio__label{
    color: unset
  }
  /deep/ .t-form__label{
    display: none;
  }
  .t-row{
    align-items: stretch;
    margin-bottom: 0px;
    //.t-form__item{
    //  width: 100%;
    //}
    .require {
      color: red;
      margin-right: 3px;
    }
    .t-col{
      border: 1px solid #ddd;
      color: #333;
      min-height: 37px;
      padding: 4px !important;
      //overflow: hidden;
      display: flex;
      align-items: center;
      margin:0px -1px -1px 0px;
    }
    .title{
      background-color: #FAFAFA;
      justify-content: center;
      margin:0px -1px -1px 0px;
      color: #606266;
    }
  }
}
</style>
